{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import datetime\n",
    "class Person():\n",
    "    def __init__(self, first_name, last_name):\n",
    "        self.first_name = first_name\n",
    "        self.last_name = last_name\n",
    "\n",
    "class Baby(Person):\n",
    "    def speak(self):\n",
    "        print('Blah blah blah')\n",
    "\n",
    "class Adult(Person):\n",
    "    def speak(self):\n",
    "        print('Hello, my name is %s' % self.first_name)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "class Calendar():\n",
    "    def book_appointment(self, date):\n",
    "        print('Booking appointment for date %s' % date)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "class OrganizedAdult(Adult, Calendar):\n",
    "    pass\n",
    "\n",
    "class OrganizedBaby(Baby, Calendar):\n",
    "    pass"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hello, my name is Andres\n",
      "Blah blah blah\n",
      "Booking appointment for date 2018-01-01\n"
     ]
    }
   ],
   "source": [
    "andres = OrganizedAdult('Andres', 'Gomez')\n",
    "boris = OrganizedBaby('Boris', 'Bumblebutton')\n",
    "\n",
    "andres.speak()\n",
    "boris.speak()\n",
    "boris.book_appointment(datetime.date(2018,1,1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "class OrganizedBaby(Baby, Calendar):\n",
    "    def book_appointment(self, date):\n",
    "        print('Note that you are booking an appointment with a baby.')\n",
    "        super().book_appointment(date)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Note that you are booking an appointment with a baby.\n",
      "Booking appointment for date 2018-01-01\n"
     ]
    }
   ],
   "source": [
    "boris = OrganizedBaby('Boris', 'Bumblebutton')\n",
    "boris.book_appointment(datetime.date(2018,1,1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
